package utils;


import org.apache.commons.lang.StringUtils;

/**
 * @author 旧巷里的少年郎
 */
public class Constants {

    private Constants() {
    }

    /**
     * 应用名
     */
    public static final String APPLY_NAME = "o2o-marketing-tool-product";
    
    public static final String API = "API";

    /**
     * 上传文件临时目录 todo
     */
    public static final String EXCEL_TEMPORARY_UPLOAD = "/data/dataTemp/upload/";

    /**
     * 点
     */
    public static final String POINT = ".";


    /**
     * 商户类型（个人）
     */
    public static final String PERSON = "PERSON|PERSON_IMPORT";

    /**
     * o2o事业群编码
     */
    public static final String YX_O2O_CODE = "08";

    /**
     * 竖线分隔符，用于数组转json
     */
    public static final String VERTICALL = "|";


    /**
     * 是否展示 N：不展示
     */
    public static final String IS_SHOW_N = "N";

    /**
     * 是否展示 Y：展示
     */
    public static final String IS_SHOW_Y = "Y";


    /**
     * 小标签
     */
    public static final String THRESSHOLD = "-1|0";


    /**
     * 删除状态判断
     */
    public static final String DELETE_WHERE = "INVALID|ERROR";

    /**
     * 竖线分隔符，用于split
     */
    public static final String VERTICAL = "\\|";

    /**
     * 统计类型-会员
     */
    public static final String MEMBER = "MEMBER";

    /**
     * 统计类型-自主发券
     */
    public static final String SENDCOUPON = "SENDCOUPON";

    /**
     * 统计类型-双向激励
     */
    public static final String INCETIVE = "INCETIVE";

    /**
     * 大总管配置需要转义的参数连接对的固定标识
     */
    public static final String PARAMS_LINK = "paramsLink=";


    public static String convertNumber(String a) {
        String b;
        int i = a.indexOf(".");
        if ("00".equals(a.substring(i + 1, a.length()))) {
            b = a.substring(0, i);
        } else if ("0".equals(a.substring(i + 2, a.length()))) {
            b = a.substring(0, i + 2);
        } else {
            b = a;
        }
        //去除-号
        if(StringUtils.isNotEmpty(b)){
            b=b.replace("-","");
        }
        return b;
    }

    public static final String QIANDAOLE_APP = "QIANDAOLE_APP";

    /**
     * 店内照
     */
    public static final String STORE_INTERIOR = "STORE_INTERIOR";

    /**
     * 门头照
     */
    public static final String STORE_SIGNBOARD = "STORE_SIGNBOARD";

    /**
     * 商服联系人类型枚举-经营联系人
     */
    public static final String MANAGER = "MANAGER";

    /**
     * 拓展信息 分隔符
     */
    public static final String EXPAND_PARTITION = "/";


    /**
     * http
     */
    public static final String HTTP = "http";

    /**
     * 立减
     */
    public static final String MINUS = "MINUS";

    /**
     * 立返
     */
    public static final String REBATE = "REBATE";

    /**
     * 消费返
     */
    public static final String CONSUME_REBATE = "CONSUME_REBATE";

    /**
     * 直领
     */
    public static final String DIRECT = "DIRECT";

    /**
     * 固返
     */
    public static final String FIXED = "FIXED";

    /**
     * 折扣
     */
    public static final String PERCENTAGE = "PERCENTAGE";

    /**
     * 随机
     */
    public static final String RANDOM = "RANDOM";

    /**
     * 指定
     */
    public static final String SPECIAL = "SPECIAL";

    /**
     * 单价立减
     */
    public static final String UNIT_PRICE = "UNIT_PRICE";

    /**
     * 固返随机
     */
    public static final String GAMMA_RANDOM = "GAMMA_RANDOM";

    /**
     * Long -1
     */
    public static final Long MINUSONE = -1L;

    /**
     * Long 0
     */
    public static final Long ZERO = 0L;

    /**
     * 现金|红包金
     */
    public static final String REBATEITEM = "CASH|COUPON";

    /**
     * 0
     */
    public static final String NUM_0 = "0";

    /**
     * -1
     */
    public static final String UNLIMITED = "-1";

    /**
     * 0
     */
    public static final Long NUMBER_0 = 0L;

    /**
     * -1
     */
    public static final Long NUMBER_UNLIMITED = -1L;

    /**
     * FAIL
     */
    public static final String FAIL = "FAIL";

    /**
     * redis key缓存前缀
     */
    public static final String REDIS_KEY = "MARKETING_TOOL_KEY_";
    /**
     * redis 中台地区缓存前缀
     */
    public static final String MALL_AREA_REDIS_KEY = "MALL_AREA_REDIS_KEY_";


    /**
     * 营销kafka消息类型 --创建
     */
    public static final String APPLY = "APPLY";

    /**
     * 营销kafka消息类型 --信息变更
     */
    public static final String MODIFY_INFO = "MODIFY_INFO";

    /**
     * 开关-开
     */
    public static final String OPEN = "open";

    /**
     * 开关-关
     */
    public static final String CLOSE = "close";

    /**
     * 活动变更维度-活动时间
     */
    public static final String MODIFY_COLUMN_DATE = "MODIFY_COLUMN_DATE";

    /**
     * 消息中心-商户提报平台编码
     */
    public static final String PLATFORM_CODE = "o2o-marketing-tool";

    /**
     * cif敏感词作用域
     */
    public static final String CIF_SCOPE = "NAME";

    /**
     * 个人商户
     */
    public static final String ACCOUNT_TYPE = "61|62|00|02|45";

    /**
     * 员工
     */
    public static final String EMPLOYEENO_TYPE = "71|72";

    /**
     * 审核状态
     */
    public static final String VERIFY_STATUS_SUCCESS = "审核通过";

    /**
     * 统计类型-今日
     */
    public static final String STATISTIC_TYPE_TO_DAY = "TO_DAY";

    /**
     * 统计类型-累计
     */
    public static final String STATISTIC_TYPE_ALL_DAY = "ALL_DAY";

    /**
     * 大数据看板场景-当日
     */
    public static final String SJ_QIANDAOLA_KANBAN = "sj_qiandaola_kanban";

    /**
     * 大数据看板场景-累计
     */
    public static final String SJ_QIANDAOLA_KANBAN_01 = "sj_qiandaola_kanban_01";

    /**
     * 商户类型 企业
     */
    public static  final String MERCHANT_TYPE_ORG = "org";

    /**
     * 商户类型 个人
     */
    public static  final String MERCHANT_TYPE_PERSON = "person";

    /**
     * 进度百分比
     */
    public static final Long RADIO = 100L;

    /**
     * 附近
     */
    public static  final String NEARBY = "附近";

    /**
     * 字符串数据100
     */
    public static final String STR_NUM_100 = "100";
}
